/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * NewJFrame1.java
 *
 * Created on Sep 1, 2011, 3:38:01 PM
 */
package Views;

import Controllers.CriminalController;
import Controllers.DBUtility;
import Controllers.PrisonerController;
import Controllers.WantedController;
import Models.Criminal;
import Models.Prisoner;
import Models.Wanted;
import java.awt.event.WindowEvent;
import java.awt.event.WindowListener;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.Vector;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JOptionPane;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import javax.swing.table.DefaultTableModel;

/**
 *
 * @author Pan
 */
public class NewJFrame1 extends javax.swing.JFrame {

    ArrayList<Criminal> criminalList = new ArrayList<Criminal>();
    ArrayList<Wanted> wantedList = new ArrayList<Wanted>();
    ArrayList<Prisoner> prisonerList = new ArrayList<Prisoner>();
    Connection conn = null;

    /** Creates new form NewJFrame1 */
    public NewJFrame1() {
        initComponents();

        criminalList = CriminalController.GetCriminals();
        wantedList = WantedController.GetWanteds();
        prisonerList = PrisonerController.GetPrisoners();
        conn = DBUtility.openConnection();
        //First, the tables must be filled with data
        LoadCriminalData(criminalList);
        LoadCriminalCase(criminalList);
        LoadWantedData(wantedList);
        LoadPrisonerData(prisonerList);
        //I must add the Selection Listener for tbl_CriminalCase manually because the tool doesn't support it
        tbl_CriminalCase.getSelectionModel().addListSelectionListener(tbl_CriminalCaseSelected());
        tbl_CriminalRecord.getSelectionModel().addListSelectionListener(tbl_CriminalRecordSelected());
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jTabbedPane1 = new javax.swing.JTabbedPane();
        jPanel1 = new javax.swing.JPanel();
        jSplitPane1 = new javax.swing.JSplitPane();
        jPanel6 = new javax.swing.JPanel();
        jPanel7 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        txtCriminalFullName = new javax.swing.JTextField();
        jLabel2 = new javax.swing.JLabel();
        cbxCriminalGender = new javax.swing.JComboBox();
        txtCriminalPlaceOfBirth = new javax.swing.JTextField();
        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        txtCriminalNationality = new javax.swing.JTextField();
        jLabel5 = new javax.swing.JLabel();
        spnMinCriminalDOB = new javax.swing.JSpinner();
        jLabel6 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        spnMaxCriminalDOB = new javax.swing.JSpinner();
        btn_FilterCriminal = new javax.swing.JButton();
        btn_ResetCriminal = new javax.swing.JButton();
        jPanel5 = new javax.swing.JPanel();
        jLabel8 = new javax.swing.JLabel();
        jLabel9 = new javax.swing.JLabel();
        spnMinCriminalHeight = new javax.swing.JSpinner();
        spnMaxCriminalHeight = new javax.swing.JSpinner();
        jLabel10 = new javax.swing.JLabel();
        jLabel11 = new javax.swing.JLabel();
        spnMaxCriminalWeight = new javax.swing.JSpinner();
        jLabel12 = new javax.swing.JLabel();
        spnMinCriminalWeight = new javax.swing.JSpinner();
        jLabel13 = new javax.swing.JLabel();
        jLabel15 = new javax.swing.JLabel();
        txtCriminalHair = new javax.swing.JTextField();
        txtCriminalRace = new javax.swing.JTextField();
        jLabel14 = new javax.swing.JLabel();
        jPanel8 = new javax.swing.JPanel();
        jLabel16 = new javax.swing.JLabel();
        txtCriminalAliases = new javax.swing.JTextField();
        cbxCriminalIsArrested = new javax.swing.JComboBox();
        jLabel17 = new javax.swing.JLabel();
        jLabel18 = new javax.swing.JLabel();
        jLabel19 = new javax.swing.JLabel();
        spnMinCriminalArrestTIme = new javax.swing.JSpinner();
        jLabel20 = new javax.swing.JLabel();
        spnMaxCriminalArrestTime = new javax.swing.JSpinner();
        jPanel9 = new javax.swing.JPanel();
        jPanel10 = new javax.swing.JPanel();
        btn_AddCriminal = new javax.swing.JButton();
        btn_EditCriminal = new javax.swing.JButton();
        btn_DetailedCriminal = new javax.swing.JButton();
        btn_Refresh = new javax.swing.JButton();
        jScrollPane1 = new javax.swing.JScrollPane();
        tbl_Criminals = new javax.swing.JTable();
        jPanel2 = new javax.swing.JPanel();
        jPanel13 = new javax.swing.JPanel();
        jScrollPane5 = new javax.swing.JScrollPane();
        tbl_CriminalCase = new javax.swing.JTable();
        btn_RefreshCriminalCase = new javax.swing.JButton();
        jPanel14 = new javax.swing.JPanel();
        jScrollPane6 = new javax.swing.JScrollPane();
        tbl_CriminalRecord = new javax.swing.JTable();
        jPanel19 = new javax.swing.JPanel();
        jLabel27 = new javax.swing.JLabel();
        lblCaseType = new javax.swing.JLabel();
        jLabel28 = new javax.swing.JLabel();
        lblCaseTime = new javax.swing.JLabel();
        jLabel39 = new javax.swing.JLabel();
        jScrollPane7 = new javax.swing.JScrollPane();
        txtCasePlace = new javax.swing.JTextArea();
        jScrollPane8 = new javax.swing.JScrollPane();
        txtCaseInvolvements = new javax.swing.JTextArea();
        lblInvolvements = new javax.swing.JLabel();
        jScrollPane9 = new javax.swing.JScrollPane();
        txtCaseDescriptions = new javax.swing.JTextArea();
        jLabel40 = new javax.swing.JLabel();
        jPanel3 = new javax.swing.JPanel();
        jSplitPane2 = new javax.swing.JSplitPane();
        jPanel15 = new javax.swing.JPanel();
        jPanel16 = new javax.swing.JPanel();
        btn_AddWanted = new javax.swing.JButton();
        btn_EditWanted = new javax.swing.JButton();
        btn_DetailedWanted = new javax.swing.JButton();
        btn_RefreshWanted = new javax.swing.JButton();
        jScrollPane2 = new javax.swing.JScrollPane();
        tbl_Wanted = new javax.swing.JTable();
        jPanel11 = new javax.swing.JPanel();
        btn_ResetWanted = new javax.swing.JButton();
        btn_FilterWanted = new javax.swing.JButton();
        spnMaxWantedDate = new javax.swing.JSpinner();
        jLabel35 = new javax.swing.JLabel();
        spnMinWantedDate = new javax.swing.JSpinner();
        jLabel31 = new javax.swing.JLabel();
        jLabel32 = new javax.swing.JLabel();
        spnMaxBountyMoney = new javax.swing.JSpinner();
        jLabel57 = new javax.swing.JLabel();
        jLabel58 = new javax.swing.JLabel();
        spnMinBountyMoney = new javax.swing.JSpinner();
        jLabel36 = new javax.swing.JLabel();
        spnMinSightingTime = new javax.swing.JSpinner();
        jLabel59 = new javax.swing.JLabel();
        jLabel60 = new javax.swing.JLabel();
        jLabel61 = new javax.swing.JLabel();
        spnMaxSightingTime = new javax.swing.JSpinner();
        txtSightingPlace = new javax.swing.JTextField();
        jLabel62 = new javax.swing.JLabel();
        jLabel63 = new javax.swing.JLabel();
        cbxInEffect = new javax.swing.JComboBox();
        jPanel4 = new javax.swing.JPanel();
        jSplitPane3 = new javax.swing.JSplitPane();
        jPanel12 = new javax.swing.JPanel();
        btn_FilterPrisoner = new javax.swing.JButton();
        btn_ResetPrisoner = new javax.swing.JButton();
        jLabel21 = new javax.swing.JLabel();
        spnMinImprisonDate = new javax.swing.JSpinner();
        jLabel33 = new javax.swing.JLabel();
        jLabel37 = new javax.swing.JLabel();
        spnMaxImprisonDate = new javax.swing.JSpinner();
        jLabel22 = new javax.swing.JLabel();
        txtPrisonName = new javax.swing.JTextField();
        txtCellNumber = new javax.swing.JTextField();
        jLabel23 = new javax.swing.JLabel();
        chxHasReleaseDate = new javax.swing.JCheckBox();
        spnMaxReleaseDate = new javax.swing.JSpinner();
        jLabel38 = new javax.swing.JLabel();
        jLabel34 = new javax.swing.JLabel();
        spnMinReleaseDate = new javax.swing.JSpinner();
        jLabel24 = new javax.swing.JLabel();
        jLabel25 = new javax.swing.JLabel();
        cbxIsReleased = new javax.swing.JComboBox();
        jLabel26 = new javax.swing.JLabel();
        jScrollPane4 = new javax.swing.JScrollPane();
        txtReleaseReason = new javax.swing.JTextArea();
        jPanel17 = new javax.swing.JPanel();
        jPanel18 = new javax.swing.JPanel();
        btn_AddPrisoner = new javax.swing.JButton();
        btn_EditPrisoner = new javax.swing.JButton();
        btn_DetailedPrisoner = new javax.swing.JButton();
        btn_RefreshPrisoner = new javax.swing.JButton();
        jScrollPane3 = new javax.swing.JScrollPane();
        tbl_Prisoner = new javax.swing.JTable();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        jSplitPane1.setDividerLocation(200);
        jSplitPane1.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT);
        jSplitPane1.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));

        jPanel6.setBorder(javax.swing.BorderFactory.createTitledBorder(new javax.swing.border.LineBorder(new java.awt.Color(0, 0, 0), 1, true), "Filter Field"));

        jPanel7.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Identification Info"));

        jLabel1.setText("Full Name:");

        jLabel2.setText("Gender:");

        cbxCriminalGender.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Both", "Male", "Female" }));

        jLabel3.setText("Place of birth:");

        jLabel4.setText("Nationality:");

        jLabel5.setText("Date of birth (mm/dd/yyyy):");

        spnMinCriminalDOB.setModel(new javax.swing.SpinnerDateModel(new java.util.Date(-946796400000L), new java.util.Date(-946796400000L), new java.util.Date(), java.util.Calendar.DAY_OF_MONTH));
        spnMinCriminalDOB.setEditor(new javax.swing.JSpinner.DateEditor(spnMinCriminalDOB, "MM/dd/yyyy"));

        jLabel6.setText("From:");

        jLabel7.setText("To:");

        spnMaxCriminalDOB.setModel(new javax.swing.SpinnerDateModel(new java.util.Date(), new java.util.Date(-946796400000L), new java.util.Date(), java.util.Calendar.DAY_OF_MONTH));
        spnMaxCriminalDOB.setEditor(new javax.swing.JSpinner.DateEditor(spnMaxCriminalDOB, "MM/dd/yyyy"));

        javax.swing.GroupLayout jPanel7Layout = new javax.swing.GroupLayout(jPanel7);
        jPanel7.setLayout(jPanel7Layout);
        jPanel7Layout.setHorizontalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel7Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel7Layout.createSequentialGroup()
                        .addComponent(jLabel1)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(txtCriminalFullName, javax.swing.GroupLayout.DEFAULT_SIZE, 136, Short.MAX_VALUE))
                    .addGroup(jPanel7Layout.createSequentialGroup()
                        .addComponent(jLabel3)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(txtCriminalPlaceOfBirth, javax.swing.GroupLayout.DEFAULT_SIZE, 119, Short.MAX_VALUE))
                    .addGroup(jPanel7Layout.createSequentialGroup()
                        .addComponent(jLabel2)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 92, Short.MAX_VALUE)
                        .addComponent(cbxCriminalGender, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addGap(18, 18, 18)
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel7Layout.createSequentialGroup()
                        .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel7)
                            .addComponent(jLabel6))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(spnMinCriminalDOB, javax.swing.GroupLayout.DEFAULT_SIZE, 185, Short.MAX_VALUE)
                            .addComponent(spnMaxCriminalDOB, javax.swing.GroupLayout.DEFAULT_SIZE, 185, Short.MAX_VALUE)))
                    .addGroup(jPanel7Layout.createSequentialGroup()
                        .addComponent(jLabel4)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(txtCriminalNationality, javax.swing.GroupLayout.DEFAULT_SIZE, 164, Short.MAX_VALUE))
                    .addComponent(jLabel5))
                .addContainerGap())
        );
        jPanel7Layout.setVerticalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel7Layout.createSequentialGroup()
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel7Layout.createSequentialGroup()
                        .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel1)
                            .addComponent(txtCriminalFullName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel4))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel2)
                            .addComponent(cbxCriminalGender, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(6, 6, 6)
                        .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(txtCriminalPlaceOfBirth, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel3)))
                    .addGroup(jPanel7Layout.createSequentialGroup()
                        .addComponent(txtCriminalNationality, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel5)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(spnMinCriminalDOB, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel6))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(spnMaxCriminalDOB, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel7))))
                .addContainerGap())
        );

        btn_FilterCriminal.setText("Filter");
        btn_FilterCriminal.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btn_FilterCriminalActionPerformed(evt);
            }
        });

        btn_ResetCriminal.setText("Reset");
        btn_ResetCriminal.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btn_ResetCriminalActionPerformed(evt);
            }
        });

        jPanel5.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Appearances"));

        jLabel8.setText("Height (cm):");

        jLabel9.setText("From:");

        spnMinCriminalHeight.setModel(new javax.swing.SpinnerNumberModel(0, 0, 1000, 1));

        spnMaxCriminalHeight.setModel(new javax.swing.SpinnerNumberModel(1000, 0, 1000, 1));

        jLabel10.setText("To:");

        jLabel11.setText("Weight (Kg):");

        spnMaxCriminalWeight.setModel(new javax.swing.SpinnerNumberModel(200, 0, 200, 1));

        jLabel12.setText("To:");

        spnMinCriminalWeight.setModel(new javax.swing.SpinnerNumberModel(0, 0, 200, 1));

        jLabel13.setText("From:");

        jLabel15.setText("Hair Color:");

        jLabel14.setText("Race:");

        javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
        jPanel5.setLayout(jPanel5Layout);
        jPanel5Layout.setHorizontalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel5Layout.createSequentialGroup()
                        .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel5Layout.createSequentialGroup()
                                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel10)
                                    .addComponent(jLabel9))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addComponent(spnMaxCriminalHeight)
                                    .addComponent(spnMinCriminalHeight, javax.swing.GroupLayout.PREFERRED_SIZE, 51, Short.MAX_VALUE)))
                            .addComponent(jLabel8))
                        .addGap(31, 31, 31)
                        .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel5Layout.createSequentialGroup()
                                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel12)
                                    .addComponent(jLabel13))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                    .addComponent(spnMinCriminalWeight)
                                    .addComponent(spnMaxCriminalWeight, javax.swing.GroupLayout.PREFERRED_SIZE, 54, javax.swing.GroupLayout.PREFERRED_SIZE)))
                            .addComponent(jLabel11)))
                    .addGroup(jPanel5Layout.createSequentialGroup()
                        .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel14)
                            .addComponent(jLabel15))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(txtCriminalRace, javax.swing.GroupLayout.DEFAULT_SIZE, 163, Short.MAX_VALUE)
                            .addComponent(txtCriminalHair, javax.swing.GroupLayout.DEFAULT_SIZE, 163, Short.MAX_VALUE))))
                .addContainerGap())
        );
        jPanel5Layout.setVerticalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(jPanel5Layout.createSequentialGroup()
                        .addComponent(jLabel8)
                        .addGap(52, 52, 52))
                    .addGroup(jPanel5Layout.createSequentialGroup()
                        .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(spnMinCriminalHeight, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel9))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(spnMaxCriminalHeight, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel10)))
                    .addGroup(jPanel5Layout.createSequentialGroup()
                        .addComponent(jLabel11)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(spnMinCriminalWeight, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel13))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(spnMaxCriminalWeight, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jLabel12))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(txtCriminalHair, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel15))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(txtCriminalRace, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel14)))
        );

        jPanel8.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Criminal Activity Info"));

        jLabel16.setText("Alias:");

        cbxCriminalIsArrested.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Both", "Arrested", "Not Arrested" }));
        cbxCriminalIsArrested.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                cbxCriminalIsArrestedItemStateChanged(evt);
            }
        });

        jLabel17.setText("Arrest status:");

        jLabel18.setText("Arrested time (mm/dd/yyyy):");

        jLabel19.setText("From:");

        spnMinCriminalArrestTIme.setModel(new javax.swing.SpinnerDateModel(new java.util.Date(-946796400000L), new java.util.Date(-946796400000L), new java.util.Date(), java.util.Calendar.DAY_OF_MONTH));
        spnMinCriminalArrestTIme.setEditor(new javax.swing.JSpinner.DateEditor(spnMinCriminalArrestTIme, "MM/dd/yyyy"));

        jLabel20.setText("To:");

        spnMaxCriminalArrestTime.setModel(new javax.swing.SpinnerDateModel(new java.util.Date(), new java.util.Date(-946796400000L), new java.util.Date(), java.util.Calendar.DAY_OF_MONTH));
        spnMaxCriminalArrestTime.setEditor(new javax.swing.JSpinner.DateEditor(spnMaxCriminalArrestTime, "MM/dd/yyyy"));

        javax.swing.GroupLayout jPanel8Layout = new javax.swing.GroupLayout(jPanel8);
        jPanel8.setLayout(jPanel8Layout);
        jPanel8Layout.setHorizontalGroup(
            jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel8Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel18)
                    .addGroup(jPanel8Layout.createSequentialGroup()
                        .addComponent(jLabel17)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(cbxCriminalIsArrested, javax.swing.GroupLayout.PREFERRED_SIZE, 78, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel8Layout.createSequentialGroup()
                        .addComponent(jLabel16)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(txtCriminalAliases, javax.swing.GroupLayout.DEFAULT_SIZE, 142, Short.MAX_VALUE))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel8Layout.createSequentialGroup()
                        .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel19)
                            .addComponent(jLabel20))
                        .addGap(18, 18, Short.MAX_VALUE)
                        .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                            .addComponent(spnMaxCriminalArrestTime, 0, 0, Short.MAX_VALUE)
                            .addComponent(spnMinCriminalArrestTIme, javax.swing.GroupLayout.DEFAULT_SIZE, 126, Short.MAX_VALUE))))
                .addContainerGap())
        );
        jPanel8Layout.setVerticalGroup(
            jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel8Layout.createSequentialGroup()
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel16)
                    .addComponent(txtCriminalAliases, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel17)
                    .addComponent(cbxCriminalIsArrested, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel18)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel19)
                    .addComponent(spnMinCriminalArrestTIme, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel20)
                    .addComponent(spnMaxCriminalArrestTime, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);
        jPanel6.setLayout(jPanel6Layout);
        jPanel6Layout.setHorizontalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel6Layout.createSequentialGroup()
                        .addComponent(btn_FilterCriminal)
                        .addGap(18, 18, 18)
                        .addComponent(btn_ResetCriminal))
                    .addComponent(jPanel7, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        jPanel6Layout.setVerticalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel6Layout.createSequentialGroup()
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel6Layout.createSequentialGroup()
                        .addComponent(jPanel7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(btn_FilterCriminal)
                            .addComponent(btn_ResetCriminal)))
                    .addComponent(jPanel5, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jPanel8, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(15, Short.MAX_VALUE))
        );

        jSplitPane1.setTopComponent(jPanel6);

        jPanel10.setBorder(javax.swing.BorderFactory.createTitledBorder("Control Panel"));

        btn_AddCriminal.setText("New Criminal");
        btn_AddCriminal.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btn_AddCriminalActionPerformed(evt);
            }
        });

        btn_EditCriminal.setText("Modify Selected Criminal");
        btn_EditCriminal.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btn_EditCriminalActionPerformed(evt);
            }
        });

        btn_DetailedCriminal.setText("View Detailed Profile");
        btn_DetailedCriminal.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btn_DetailedCriminalActionPerformed(evt);
            }
        });

        btn_Refresh.setText("Refresh");
        btn_Refresh.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btn_RefreshActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel10Layout = new javax.swing.GroupLayout(jPanel10);
        jPanel10.setLayout(jPanel10Layout);
        jPanel10Layout.setHorizontalGroup(
            jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel10Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                        .addComponent(btn_DetailedCriminal, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(btn_EditCriminal, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(btn_AddCriminal, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addComponent(btn_Refresh, javax.swing.GroupLayout.DEFAULT_SIZE, 149, Short.MAX_VALUE))
                .addContainerGap())
        );
        jPanel10Layout.setVerticalGroup(
            jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel10Layout.createSequentialGroup()
                .addComponent(btn_AddCriminal)
                .addGap(18, 18, 18)
                .addComponent(btn_EditCriminal)
                .addGap(18, 18, 18)
                .addComponent(btn_DetailedCriminal)
                .addGap(18, 18, 18)
                .addComponent(btn_Refresh)
                .addContainerGap(58, Short.MAX_VALUE))
        );

        tbl_Criminals.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null},
                {null, null, null, null, null, null, null}
            },
            new String [] {
                "Criminal ID", "Full Name", "Gender", "Date of birth (mm/dd/yyyy)", "Nationality", "Is Arrested?", "ArrestedTime"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.Integer.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.Boolean.class, java.lang.String.class
            };
            boolean[] canEdit = new boolean [] {
                false, false, false, false, false, false, false
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        tbl_Criminals.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
        tbl_Criminals.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
        tbl_Criminals.getTableHeader().setReorderingAllowed(false);
        jScrollPane1.setViewportView(tbl_Criminals);

        javax.swing.GroupLayout jPanel9Layout = new javax.swing.GroupLayout(jPanel9);
        jPanel9.setLayout(jPanel9Layout);
        jPanel9Layout.setHorizontalGroup(
            jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel9Layout.createSequentialGroup()
                .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 768, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel10, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        );
        jPanel9Layout.setVerticalGroup(
            jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel10, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 234, Short.MAX_VALUE)
        );

        jSplitPane1.setRightComponent(jPanel9);

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jSplitPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 961, Short.MAX_VALUE)
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jSplitPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 440, Short.MAX_VALUE)
        );

        jTabbedPane1.addTab("Criminal Manager", jPanel1);

        jPanel13.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Criminal List"));

        tbl_CriminalCase.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null},
                {null, null},
                {null, null},
                {null, null}
            },
            new String [] {
                "Criminal ID", "Criminal Name"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.Integer.class, java.lang.String.class
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }
        });
        tbl_CriminalCase.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
        tbl_CriminalCase.getTableHeader().setReorderingAllowed(false);
        jScrollPane5.setViewportView(tbl_CriminalCase);

        btn_RefreshCriminalCase.setText("Refresh");
        btn_RefreshCriminalCase.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btn_RefreshCriminalCaseActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel13Layout = new javax.swing.GroupLayout(jPanel13);
        jPanel13.setLayout(jPanel13Layout);
        jPanel13Layout.setHorizontalGroup(
            jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel13Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane5, javax.swing.GroupLayout.PREFERRED_SIZE, 265, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 12, Short.MAX_VALUE)
                .addComponent(btn_RefreshCriminalCase)
                .addContainerGap())
        );
        jPanel13Layout.setVerticalGroup(
            jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel13Layout.createSequentialGroup()
                .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane5, javax.swing.GroupLayout.PREFERRED_SIZE, 170, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btn_RefreshCriminalCase))
                .addContainerGap(14, Short.MAX_VALUE))
        );

        jPanel14.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Criminal Records"));

        tbl_CriminalRecord.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null},
                {null, null, null},
                {null, null, null},
                {null, null, null}
            },
            new String [] {
                "Case ID", "Charged Crime", "Role in Case"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.String.class, java.lang.String.class, java.lang.String.class
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }
        });
        tbl_CriminalRecord.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
        jScrollPane6.setViewportView(tbl_CriminalRecord);

        javax.swing.GroupLayout jPanel14Layout = new javax.swing.GroupLayout(jPanel14);
        jPanel14.setLayout(jPanel14Layout);
        jPanel14Layout.setHorizontalGroup(
            jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel14Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane6, javax.swing.GroupLayout.DEFAULT_SIZE, 548, Short.MAX_VALUE)
                .addContainerGap())
        );
        jPanel14Layout.setVerticalGroup(
            jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel14Layout.createSequentialGroup()
                .addComponent(jScrollPane6, javax.swing.GroupLayout.DEFAULT_SIZE, 173, Short.MAX_VALUE)
                .addContainerGap())
        );

        jPanel19.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Detailed Record"));

        jLabel27.setText("Type:");

        lblCaseType.setText("[Case Type]");

        jLabel28.setText("Time:");

        lblCaseTime.setText("[Case Time]");

        jLabel39.setText("Crime Scene at:");

        txtCasePlace.setColumns(20);
        txtCasePlace.setEditable(false);
        txtCasePlace.setLineWrap(true);
        txtCasePlace.setRows(5);
        jScrollPane7.setViewportView(txtCasePlace);

        txtCaseInvolvements.setColumns(20);
        txtCaseInvolvements.setEditable(false);
        txtCaseInvolvements.setLineWrap(true);
        txtCaseInvolvements.setRows(5);
        jScrollPane8.setViewportView(txtCaseInvolvements);

        lblInvolvements.setText("Involvements:");

        txtCaseDescriptions.setColumns(20);
        txtCaseDescriptions.setEditable(false);
        txtCaseDescriptions.setLineWrap(true);
        txtCaseDescriptions.setRows(5);
        jScrollPane9.setViewportView(txtCaseDescriptions);

        jLabel40.setText("Full Descriptions:");

        javax.swing.GroupLayout jPanel19Layout = new javax.swing.GroupLayout(jPanel19);
        jPanel19.setLayout(jPanel19Layout);
        jPanel19Layout.setHorizontalGroup(
            jPanel19Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel19Layout.createSequentialGroup()
                .addGroup(jPanel19Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel19Layout.createSequentialGroup()
                        .addGap(10, 10, 10)
                        .addComponent(jLabel27))
                    .addGroup(jPanel19Layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(lblCaseType))
                    .addGroup(jPanel19Layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jLabel28))
                    .addGroup(jPanel19Layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(lblCaseTime)))
                .addGap(100, 100, 100)
                .addGroup(jPanel19Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel19Layout.createSequentialGroup()
                        .addComponent(jScrollPane7)
                        .addGap(18, 18, 18)
                        .addComponent(jScrollPane8, javax.swing.GroupLayout.DEFAULT_SIZE, 166, Short.MAX_VALUE)
                        .addGap(18, 18, 18))
                    .addGroup(jPanel19Layout.createSequentialGroup()
                        .addComponent(jLabel39)
                        .addGap(108, 108, 108)
                        .addComponent(lblInvolvements, javax.swing.GroupLayout.DEFAULT_SIZE, 69, Short.MAX_VALUE)
                        .addGap(115, 115, 115)))
                .addGroup(jPanel19Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(jPanel19Layout.createSequentialGroup()
                        .addComponent(jLabel40, javax.swing.GroupLayout.DEFAULT_SIZE, 81, Short.MAX_VALUE)
                        .addGap(330, 330, 330))
                    .addGroup(jPanel19Layout.createSequentialGroup()
                        .addComponent(jScrollPane9, javax.swing.GroupLayout.DEFAULT_SIZE, 353, Short.MAX_VALUE)
                        .addGap(58, 58, 58))))
        );
        jPanel19Layout.setVerticalGroup(
            jPanel19Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel19Layout.createSequentialGroup()
                .addGap(11, 11, 11)
                .addGroup(jPanel19Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel27)
                    .addComponent(jLabel39)
                    .addGroup(jPanel19Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(lblInvolvements)
                        .addComponent(jLabel40)))
                .addGap(6, 6, 6)
                .addGroup(jPanel19Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jScrollPane7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(jPanel19Layout.createSequentialGroup()
                        .addComponent(lblCaseType)
                        .addGap(18, 18, 18)
                        .addComponent(jLabel28)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(lblCaseTime))
                    .addComponent(jScrollPane9, javax.swing.GroupLayout.DEFAULT_SIZE, 162, Short.MAX_VALUE))
                .addContainerGap())
        );

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addComponent(jPanel13, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addComponent(jPanel14, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
            .addComponent(jPanel19, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel13, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jPanel14, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addComponent(jPanel19, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        );

        jTabbedPane1.addTab("Criminal Record", jPanel2);

        jSplitPane2.setDividerLocation(200);
        jSplitPane2.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT);
        jSplitPane2.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));

        jPanel16.setBorder(javax.swing.BorderFactory.createTitledBorder("Control Panel"));

        btn_AddWanted.setText("New Bounty");
        btn_AddWanted.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btn_AddWantedActionPerformed(evt);
            }
        });

        btn_EditWanted.setText("Update Selected Bounty");
        btn_EditWanted.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btn_EditWantedActionPerformed(evt);
            }
        });

        btn_DetailedWanted.setText("View Detailed Bounty");
        btn_DetailedWanted.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btn_DetailedWantedActionPerformed(evt);
            }
        });

        btn_RefreshWanted.setText("Refresh");
        btn_RefreshWanted.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btn_RefreshWantedActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel16Layout = new javax.swing.GroupLayout(jPanel16);
        jPanel16.setLayout(jPanel16Layout);
        jPanel16Layout.setHorizontalGroup(
            jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel16Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(btn_DetailedWanted, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 149, Short.MAX_VALUE)
                    .addComponent(btn_RefreshWanted, javax.swing.GroupLayout.DEFAULT_SIZE, 149, Short.MAX_VALUE)
                    .addComponent(btn_EditWanted, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 149, Short.MAX_VALUE)
                    .addComponent(btn_AddWanted, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 149, Short.MAX_VALUE))
                .addContainerGap())
        );
        jPanel16Layout.setVerticalGroup(
            jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel16Layout.createSequentialGroup()
                .addComponent(btn_AddWanted)
                .addGap(18, 18, 18)
                .addComponent(btn_EditWanted)
                .addGap(18, 18, 18)
                .addComponent(btn_DetailedWanted)
                .addGap(18, 18, 18)
                .addComponent(btn_RefreshWanted)
                .addContainerGap(47, Short.MAX_VALUE))
        );

        tbl_Wanted.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null, null},
                {null, null, null, null, null},
                {null, null, null, null, null},
                {null, null, null, null, null}
            },
            new String [] {
                "Wanted ID", "Fugitive Name", "Wanted Date (mm/dd/yyyy)", "Bounty Money (INR)", "In Effect?"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.Integer.class, java.lang.String.class, java.lang.String.class, java.lang.Integer.class, java.lang.Boolean.class
            };
            boolean[] canEdit = new boolean [] {
                false, false, false, false, false
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        tbl_Wanted.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
        tbl_Wanted.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
        tbl_Wanted.getTableHeader().setReorderingAllowed(false);
        jScrollPane2.setViewportView(tbl_Wanted);

        javax.swing.GroupLayout jPanel15Layout = new javax.swing.GroupLayout(jPanel15);
        jPanel15.setLayout(jPanel15Layout);
        jPanel15Layout.setHorizontalGroup(
            jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel15Layout.createSequentialGroup()
                .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 768, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel16, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        );
        jPanel15Layout.setVerticalGroup(
            jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel15Layout.createSequentialGroup()
                .addComponent(jPanel16, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
            .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 234, Short.MAX_VALUE)
        );

        jSplitPane2.setRightComponent(jPanel15);

        jPanel11.setBorder(javax.swing.BorderFactory.createTitledBorder(new javax.swing.border.LineBorder(new java.awt.Color(0, 0, 0), 1, true), "Filter Field"));

        btn_ResetWanted.setText("Reset");
        btn_ResetWanted.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btn_ResetWantedActionPerformed(evt);
            }
        });

        btn_FilterWanted.setText("Filter");
        btn_FilterWanted.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btn_FilterWantedActionPerformed(evt);
            }
        });

        spnMaxWantedDate.setModel(new javax.swing.SpinnerDateModel(new java.util.Date(), new java.util.Date(-946796400000L), new java.util.Date(), java.util.Calendar.DAY_OF_MONTH));
        spnMaxWantedDate.setEditor(new javax.swing.JSpinner.DateEditor(spnMaxWantedDate, "MM/dd/yyyy"));

        jLabel35.setText("To:");

        spnMinWantedDate.setModel(new javax.swing.SpinnerDateModel(new java.util.Date(-946796400000L), new java.util.Date(-946796400000L), new java.util.Date(), java.util.Calendar.DAY_OF_MONTH));
        spnMinWantedDate.setEditor(new javax.swing.JSpinner.DateEditor(spnMinWantedDate, "MM/dd/yyyy"));

        jLabel31.setText("Wanted Date (mm/dd/yyyy):");

        jLabel32.setText("From:");

        spnMaxBountyMoney.setModel(new javax.swing.SpinnerNumberModel(1000000000, 0, 1000000000, 1));

        jLabel57.setText("To:");

        jLabel58.setText("From:");

        spnMinBountyMoney.setModel(new javax.swing.SpinnerNumberModel(0, 0, 1000000000, 1));

        jLabel36.setText("Bounty Money (INR):");

        spnMinSightingTime.setModel(new javax.swing.SpinnerDateModel(new java.util.Date(-946796400000L), new java.util.Date(-946796400000L), new java.util.Date(), java.util.Calendar.DAY_OF_MONTH));
        spnMinSightingTime.setEditor(new javax.swing.JSpinner.DateEditor(spnMinSightingTime, "MM/dd/yyyy hh:mm:ss"));
        spnMinSightingTime.setEnabled(false);

        jLabel59.setText("From:");

        jLabel60.setText("Sighting Time:");

        jLabel61.setText("To:");

        spnMaxSightingTime.setModel(new javax.swing.SpinnerDateModel(new java.util.Date(), new java.util.Date(-946796400000L), new java.util.Date(), java.util.Calendar.DAY_OF_MONTH));
        spnMaxSightingTime.setEditor(new javax.swing.JSpinner.DateEditor(spnMaxSightingTime, "MM/dd/yyyy hh:mm:ss"));
        spnMaxSightingTime.setEnabled(false);

        txtSightingPlace.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusLost(java.awt.event.FocusEvent evt) {
                txtSightingPlaceFocusLost(evt);
            }
        });

        jLabel62.setText("Sighting Place:");

        jLabel63.setText("In Effect?");

        cbxInEffect.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Both", "Yes", "No" }));

        javax.swing.GroupLayout jPanel11Layout = new javax.swing.GroupLayout(jPanel11);
        jPanel11.setLayout(jPanel11Layout);
        jPanel11Layout.setHorizontalGroup(
            jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel11Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel11Layout.createSequentialGroup()
                        .addComponent(btn_FilterWanted)
                        .addGap(18, 18, 18)
                        .addComponent(btn_ResetWanted))
                    .addGroup(jPanel11Layout.createSequentialGroup()
                        .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel35)
                            .addComponent(jLabel32))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(spnMinWantedDate)
                            .addComponent(spnMaxWantedDate))
                        .addGap(18, 18, 18)
                        .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel11Layout.createSequentialGroup()
                                .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel62)
                                    .addComponent(jLabel63))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(txtSightingPlace, javax.swing.GroupLayout.PREFERRED_SIZE, 113, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(cbxInEffect, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                            .addGroup(jPanel11Layout.createSequentialGroup()
                                .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel36)
                                    .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                        .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel11Layout.createSequentialGroup()
                                            .addComponent(jLabel58)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                            .addComponent(spnMinBountyMoney, 0, 0, Short.MAX_VALUE))
                                        .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel11Layout.createSequentialGroup()
                                            .addComponent(jLabel57)
                                            .addGap(18, 18, 18)
                                            .addComponent(spnMaxBountyMoney, javax.swing.GroupLayout.PREFERRED_SIZE, 101, javax.swing.GroupLayout.PREFERRED_SIZE))))
                                .addGap(18, 18, 18)
                                .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel60)
                                    .addGroup(jPanel11Layout.createSequentialGroup()
                                        .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(jLabel59)
                                            .addComponent(jLabel61))
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(spnMaxSightingTime, javax.swing.GroupLayout.PREFERRED_SIZE, 140, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(spnMinSightingTime, 0, 0, Short.MAX_VALUE)))))))
                    .addComponent(jLabel31))
                .addContainerGap(455, javax.swing.GroupLayout.PREFERRED_SIZE))
        );
        jPanel11Layout.setVerticalGroup(
            jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel11Layout.createSequentialGroup()
                .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel11Layout.createSequentialGroup()
                        .addComponent(jLabel31)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(spnMinWantedDate, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel32))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(spnMaxWantedDate, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel35))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 75, Short.MAX_VALUE)
                        .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(btn_FilterWanted)
                            .addComponent(btn_ResetWanted)))
                    .addGroup(jPanel11Layout.createSequentialGroup()
                        .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel11Layout.createSequentialGroup()
                                .addComponent(jLabel60)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(jLabel59)
                                    .addComponent(spnMinSightingTime, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(spnMaxSightingTime, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jLabel61)))
                            .addGroup(jPanel11Layout.createSequentialGroup()
                                .addComponent(jLabel36)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(jLabel58)
                                    .addComponent(spnMinBountyMoney, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(jLabel57)
                                    .addComponent(spnMaxBountyMoney, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
                        .addGap(18, 18, 18)
                        .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel62)
                            .addComponent(txtSightingPlace, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(cbxInEffect, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel63))))
                .addContainerGap())
        );

        jSplitPane2.setLeftComponent(jPanel11);

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jSplitPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 961, Short.MAX_VALUE)
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jSplitPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 440, Short.MAX_VALUE)
        );

        jTabbedPane1.addTab("Wanted Fugitives", jPanel3);

        jSplitPane3.setDividerLocation(200);
        jSplitPane3.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT);
        jSplitPane3.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));

        jPanel12.setBorder(javax.swing.BorderFactory.createTitledBorder(new javax.swing.border.LineBorder(new java.awt.Color(0, 0, 0), 1, true), "Filter Field"));

        btn_FilterPrisoner.setText("Filter");
        btn_FilterPrisoner.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btn_FilterPrisonerActionPerformed(evt);
            }
        });

        btn_ResetPrisoner.setText("Reset");
        btn_ResetPrisoner.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btn_ResetPrisonerActionPerformed(evt);
            }
        });

        jLabel21.setText("Imprison Date (mm/dd/yyyy):");

        spnMinImprisonDate.setModel(new javax.swing.SpinnerDateModel(new java.util.Date(-946796400000L), new java.util.Date(-946796400000L), new java.util.Date(), java.util.Calendar.DAY_OF_MONTH));
        spnMinImprisonDate.setEditor(new javax.swing.JSpinner.DateEditor(spnMinImprisonDate, "MM/dd/yyyy"));

        jLabel33.setText("From:");

        jLabel37.setText("To:");

        spnMaxImprisonDate.setModel(new javax.swing.SpinnerDateModel(new java.util.Date(), new java.util.Date(-946796400000L), new java.util.Date(), java.util.Calendar.DAY_OF_MONTH));
        spnMaxImprisonDate.setEditor(new javax.swing.JSpinner.DateEditor(spnMaxImprisonDate, "MM/dd/yyyy"));

        jLabel22.setText("Prison Name:");

        jLabel23.setText("Cell Plate:");

        chxHasReleaseDate.setText("Has Release Date");
        chxHasReleaseDate.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                chxHasReleaseDateItemStateChanged(evt);
            }
        });

        spnMaxReleaseDate.setModel(new javax.swing.SpinnerDateModel(new java.util.Date(), new java.util.Date(-946796400000L), new java.util.Date(), java.util.Calendar.DAY_OF_MONTH));
        spnMaxReleaseDate.setEditor(new javax.swing.JSpinner.DateEditor(spnMaxReleaseDate, "MM/dd/yyyy"));
        spnMaxReleaseDate.setEnabled(false);

        jLabel38.setText("To:");

        jLabel34.setText("From:");

        spnMinReleaseDate.setModel(new javax.swing.SpinnerDateModel(new java.util.Date(-946796400000L), new java.util.Date(-946796400000L), new java.util.Date(), java.util.Calendar.DAY_OF_MONTH));
        spnMinReleaseDate.setEditor(new javax.swing.JSpinner.DateEditor(spnMinReleaseDate, "MM/dd/yyyy"));
        spnMinReleaseDate.setEnabled(false);

        jLabel24.setText("Release Date (mm/dd/yyyy):");

        jLabel25.setText("Is Released?");

        cbxIsReleased.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Both", "Yes", "No" }));

        jLabel26.setText("Release Reason:");

        txtReleaseReason.setColumns(20);
        txtReleaseReason.setLineWrap(true);
        txtReleaseReason.setRows(5);
        jScrollPane4.setViewportView(txtReleaseReason);

        javax.swing.GroupLayout jPanel12Layout = new javax.swing.GroupLayout(jPanel12);
        jPanel12.setLayout(jPanel12Layout);
        jPanel12Layout.setHorizontalGroup(
            jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel12Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel12Layout.createSequentialGroup()
                        .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel21)
                            .addGroup(jPanel12Layout.createSequentialGroup()
                                .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel37)
                                    .addComponent(jLabel33))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addComponent(spnMinImprisonDate)
                                    .addComponent(spnMaxImprisonDate, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
                        .addGap(38, 38, 38)
                        .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel23)
                            .addComponent(jLabel22))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(txtPrisonName, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(txtCellNumber, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(18, 18, 18)
                        .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(chxHasReleaseDate)
                            .addComponent(jLabel24)
                            .addGroup(jPanel12Layout.createSequentialGroup()
                                .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel38)
                                    .addComponent(jLabel34))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addComponent(spnMinReleaseDate)
                                    .addComponent(spnMaxReleaseDate, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))))
                    .addGroup(jPanel12Layout.createSequentialGroup()
                        .addComponent(btn_FilterPrisoner)
                        .addGap(18, 18, 18)
                        .addComponent(btn_ResetPrisoner)))
                .addGap(34, 34, 34)
                .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel26)
                    .addGroup(jPanel12Layout.createSequentialGroup()
                        .addComponent(jLabel25)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(cbxIsReleased, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(183, Short.MAX_VALUE))
        );
        jPanel12Layout.setVerticalGroup(
            jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel12Layout.createSequentialGroup()
                .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel21)
                    .addComponent(jLabel22)
                    .addComponent(txtPrisonName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(chxHasReleaseDate)
                    .addComponent(jLabel25)
                    .addComponent(cbxIsReleased, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel12Layout.createSequentialGroup()
                        .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(spnMinImprisonDate, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel33)
                            .addComponent(txtCellNumber, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel23))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(spnMaxImprisonDate, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel37)))
                    .addGroup(jPanel12Layout.createSequentialGroup()
                        .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel24)
                            .addComponent(jLabel26))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel12Layout.createSequentialGroup()
                                .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(spnMinReleaseDate, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jLabel34))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(spnMaxReleaseDate, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jLabel38)))
                            .addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
                .addContainerGap(32, Short.MAX_VALUE))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel12Layout.createSequentialGroup()
                .addContainerGap(141, Short.MAX_VALUE)
                .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(btn_FilterPrisoner)
                    .addComponent(btn_ResetPrisoner))
                .addContainerGap())
        );

        jSplitPane3.setTopComponent(jPanel12);

        jPanel18.setBorder(javax.swing.BorderFactory.createTitledBorder("Control Panel"));

        btn_AddPrisoner.setText("New Imprisonment");
        btn_AddPrisoner.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btn_AddPrisonerActionPerformed(evt);
            }
        });

        btn_EditPrisoner.setText("Updated Select Prisoner");
        btn_EditPrisoner.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btn_EditPrisonerActionPerformed(evt);
            }
        });

        btn_DetailedPrisoner.setText("View Detailed Prisoner");
        btn_DetailedPrisoner.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btn_DetailedPrisonerActionPerformed(evt);
            }
        });

        btn_RefreshPrisoner.setText("Refresh");
        btn_RefreshPrisoner.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btn_RefreshPrisonerActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel18Layout = new javax.swing.GroupLayout(jPanel18);
        jPanel18.setLayout(jPanel18Layout);
        jPanel18Layout.setHorizontalGroup(
            jPanel18Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel18Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel18Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(btn_DetailedPrisoner, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 149, Short.MAX_VALUE)
                    .addComponent(btn_RefreshPrisoner, javax.swing.GroupLayout.DEFAULT_SIZE, 149, Short.MAX_VALUE)
                    .addComponent(btn_EditPrisoner, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 149, Short.MAX_VALUE)
                    .addComponent(btn_AddPrisoner, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 149, Short.MAX_VALUE))
                .addContainerGap())
        );
        jPanel18Layout.setVerticalGroup(
            jPanel18Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel18Layout.createSequentialGroup()
                .addComponent(btn_AddPrisoner)
                .addGap(18, 18, 18)
                .addComponent(btn_EditPrisoner)
                .addGap(18, 18, 18)
                .addComponent(btn_DetailedPrisoner)
                .addGap(18, 18, 18)
                .addComponent(btn_RefreshPrisoner)
                .addContainerGap(58, Short.MAX_VALUE))
        );

        tbl_Prisoner.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null, null, null},
                {null, null, null, null, null, null},
                {null, null, null, null, null, null},
                {null, null, null, null, null, null}
            },
            new String [] {
                "Prisoner ID", "Prisoner Name", "Imprison Date (mm/dd/yyyy)", "Release Date (mm/dd/yyyy)", "Prison Name", "Is Released?"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.Integer.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.Boolean.class
            };
            boolean[] canEdit = new boolean [] {
                false, false, false, false, false, false
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        tbl_Prisoner.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
        tbl_Prisoner.getTableHeader().setReorderingAllowed(false);
        jScrollPane3.setViewportView(tbl_Prisoner);

        javax.swing.GroupLayout jPanel17Layout = new javax.swing.GroupLayout(jPanel17);
        jPanel17.setLayout(jPanel17Layout);
        jPanel17Layout.setHorizontalGroup(
            jPanel17Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel17Layout.createSequentialGroup()
                .addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 758, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel18, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        jPanel17Layout.setVerticalGroup(
            jPanel17Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel18, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 234, Short.MAX_VALUE)
        );

        jSplitPane3.setRightComponent(jPanel17);

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jSplitPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 961, Short.MAX_VALUE)
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jSplitPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 440, Short.MAX_VALUE)
        );

        jTabbedPane1.addTab("Prisoners", jPanel4);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jTabbedPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 966, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jTabbedPane1)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

private void btn_AddCriminalActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_AddCriminalActionPerformed
    AddCriminal addCriminal = new AddCriminal(null, true);
    //Adding this event will force the Criminal table to refresh automatically once the New Criminal dialog is closed
    addCriminal.addWindowListener(new WindowListener() {

        @Override
        public void windowOpened(WindowEvent e) {
        }

        @Override
        public void windowClosing(WindowEvent e) {
        }

        @Override
        public void windowClosed(WindowEvent e) {
            btn_Refresh.doClick();
        }

        @Override
        public void windowIconified(WindowEvent e) {
        }

        @Override
        public void windowDeiconified(WindowEvent e) {
        }

        @Override
        public void windowActivated(WindowEvent e) {
        }

        @Override
        public void windowDeactivated(WindowEvent e) {
        }
    });
    addCriminal.setVisible(true);
}//GEN-LAST:event_btn_AddCriminalActionPerformed

private void btn_EditCriminalActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_EditCriminalActionPerformed
    if (tbl_Criminals.getSelectedRowCount() < 1) {
        JOptionPane.showMessageDialog(null, "No Criminal selected!", "Error Message", JOptionPane.WARNING_MESSAGE);
    } else {
        int _ID = Integer.parseInt(tbl_Criminals.getModel().getValueAt(tbl_Criminals.getSelectedRow(), 0).toString());
        Criminal modifiedCriminal = new Criminal(_ID);
        EditCriminal editCriminal = new EditCriminal(null, true, modifiedCriminal);
        editCriminal.addWindowListener(new WindowListener() {

            @Override
            public void windowOpened(WindowEvent e) {
            }

            @Override
            public void windowClosing(WindowEvent e) {
            }

            @Override
            public void windowClosed(WindowEvent e) {
                btn_Refresh.doClick();
            }

            @Override
            public void windowIconified(WindowEvent e) {
            }

            @Override
            public void windowDeiconified(WindowEvent e) {
            }

            @Override
            public void windowActivated(WindowEvent e) {
            }

            @Override
            public void windowDeactivated(WindowEvent e) {
            }
        });
        editCriminal.setVisible(true);
    }
}//GEN-LAST:event_btn_EditCriminalActionPerformed

private void btn_DetailedCriminalActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_DetailedCriminalActionPerformed
    if (tbl_Criminals.getSelectedRowCount() < 1) {
        JOptionPane.showMessageDialog(null, "No Criminal selected!", "Error Message", JOptionPane.WARNING_MESSAGE);
    } else {
        int _ID = Integer.parseInt(tbl_Criminals.getModel().getValueAt(tbl_Criminals.getSelectedRow(), 0).toString());
        DetailedCriminal detailCriminal = new DetailedCriminal(null, true, new Criminal(_ID));
        detailCriminal.setVisible(true);
    }
}//GEN-LAST:event_btn_DetailedCriminalActionPerformed

private void btn_RefreshActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_RefreshActionPerformed
    criminalList = CriminalController.GetCriminals();
    LoadCriminalData(criminalList);
}//GEN-LAST:event_btn_RefreshActionPerformed

private void btn_FilterCriminalActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_FilterCriminalActionPerformed
    SimpleDateFormat formatter = new SimpleDateFormat("MM/dd/yyyy");
    SimpleDateFormat ArrestedTimeFormat = new SimpleDateFormat("MM/dd/yyyy hh:mm:ss");
    ArrayList<Criminal> resultList = new ArrayList<Criminal>();

    //The parameters will be sent through a HashMap because it can retain the object's type
    //and the code will be shorter
    HashMap parametersMap = new HashMap();
    parametersMap.put("FullName", txtCriminalFullName.getText().trim());
    String _gender = "";
    if (cbxCriminalGender.getSelectedIndex() == 1) {
        _gender = "1";
    } else if (cbxCriminalGender.getSelectedIndex() == 2) {
        _gender = "0";
    }
    parametersMap.put("Gender", _gender);
    Date _minDOB = null;
    Date _maxDOB = null;
    try {
        String dateString = formatter.format(spnMinCriminalDOB.getValue());
        _minDOB = formatter.parse(dateString);
        dateString = formatter.format(spnMaxCriminalDOB.getValue());
        _maxDOB = formatter.parse(dateString);
    } catch (ParseException ex) {
        Logger.getLogger(NewJFrame1.class.getName()).log(Level.SEVERE, null, ex);
    }
    parametersMap.put("MinDOB", _minDOB);
    parametersMap.put("MaxDOB", _maxDOB);
    parametersMap.put("PlaceOfBirth", txtCriminalPlaceOfBirth.getText().trim());
    parametersMap.put("Nationality", txtCriminalNationality.getText().trim());
    parametersMap.put("MinHeight", Integer.parseInt(spnMinCriminalHeight.getValue().toString()));
    parametersMap.put("MaxHeight", Integer.parseInt(spnMaxCriminalHeight.getValue().toString()));
    parametersMap.put("MinWeight", Integer.parseInt(spnMinCriminalWeight.getValue().toString()));
    parametersMap.put("MaxWeight", Integer.parseInt(spnMaxCriminalWeight.getValue().toString()));
    parametersMap.put("Hair", txtCriminalHair.getText().trim());
    parametersMap.put("Race", txtCriminalRace.getText().trim());
    parametersMap.put("Aliases", txtCriminalAliases.getText().trim());
    Date _minArrestedTime = null;
    Date _maxArrestedTime = null;
    try {
        String dateString = ArrestedTimeFormat.format(spnMinCriminalArrestTIme.getValue());
        _minArrestedTime = ArrestedTimeFormat.parse(dateString);
        dateString = ArrestedTimeFormat.format(spnMaxCriminalArrestTime.getValue());
        _maxArrestedTime = ArrestedTimeFormat.parse(dateString);
    } catch (ParseException ex) {
        Logger.getLogger(NewJFrame1.class.getName()).log(Level.SEVERE, null, ex);
    }
    parametersMap.put("MinArrestedTime", _minArrestedTime);
    parametersMap.put("MaxArrestedTime", _maxArrestedTime);
    String _isarrested = "";
    //We have 2 filter mode for Criminals table, one for arrest status specific, one for both
    //This is because we cannot select the entire table with supplied MinArrestedDate and MaxArrestedDate
    if (cbxCriminalIsArrested.getSelectedIndex() == 1) {
        _isarrested = "1";
        parametersMap.put("IsArrested", _isarrested);
        resultList = CriminalController.FilterCriminal(parametersMap);
    } else if (cbxCriminalIsArrested.getSelectedIndex() == 2) {
        _isarrested = "0";
        parametersMap.put("IsArrested", _isarrested);
        resultList = CriminalController.FilterCriminalNotArrested(parametersMap);
    } else {
        //Assuming the arrest status is at 'Both'
        parametersMap.put("IsArrested", _isarrested);
        resultList = CriminalController.FilterCriminalNotArrested(parametersMap);
    }
    LoadCriminalData(resultList);
}//GEN-LAST:event_btn_FilterCriminalActionPerformed

private void btn_ResetCriminalActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_ResetCriminalActionPerformed
    SimpleDateFormat formatter = new SimpleDateFormat("MM/dd/yyyy");

    txtCriminalFullName.setText("");
    cbxCriminalGender.setSelectedIndex(0);
    txtCriminalPlaceOfBirth.setText("");
    txtCriminalNationality.setText("");
    Calendar cal = Calendar.getInstance();
    try {
        spnMinCriminalDOB.setValue(formatter.parse("01/01/1940"));
        spnMaxCriminalDOB.setValue(cal.getTime());
        spnMinCriminalArrestTIme.setValue(formatter.parse("01/01/1940"));
        spnMaxCriminalArrestTime.setValue(cal.getTime());
    } catch (ParseException ex) {
        Logger.getLogger(NewJFrame1.class.getName()).log(Level.SEVERE, null, ex);
    }
    spnMinCriminalHeight.setValue(0);
    spnMaxCriminalHeight.setValue(1000);
    spnMinCriminalWeight.setValue(0);
    spnMaxCriminalWeight.setValue(200);
    txtCriminalHair.setText("");
    txtCriminalRace.setText("");
    txtCriminalAliases.setText("");
    cbxCriminalIsArrested.setSelectedIndex(0);

    btn_Refresh.doClick();
}//GEN-LAST:event_btn_ResetCriminalActionPerformed

private void cbxCriminalIsArrestedItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_cbxCriminalIsArrestedItemStateChanged
    if (cbxCriminalIsArrested.getSelectedIndex() == 1) {
        spnMinCriminalArrestTIme.setEnabled(true);
        spnMaxCriminalArrestTime.setEnabled(true);
    } else if (cbxCriminalIsArrested.getSelectedIndex() == 2 || cbxCriminalIsArrested.getSelectedIndex() == 0) {
        spnMinCriminalArrestTIme.setEnabled(false);
        spnMaxCriminalArrestTime.setEnabled(false);
    }
}//GEN-LAST:event_cbxCriminalIsArrestedItemStateChanged

private void btn_RefreshWantedActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_RefreshWantedActionPerformed
    wantedList = WantedController.GetWanteds();
    LoadWantedData(wantedList);
}//GEN-LAST:event_btn_RefreshWantedActionPerformed

private void btn_DetailedWantedActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_DetailedWantedActionPerformed
    if (tbl_Wanted.getSelectedRowCount() < 1) {
        JOptionPane.showMessageDialog(null, "No Bounty record selected!", "Error Message", JOptionPane.WARNING_MESSAGE);
    } else {
        int _ID = Integer.parseInt(tbl_Wanted.getModel().getValueAt(tbl_Wanted.getSelectedRow(), 0).toString());
        DetailedWanted detailWanted = new DetailedWanted(null, true, new Wanted(_ID));
        detailWanted.setVisible(true);
    }
}//GEN-LAST:event_btn_DetailedWantedActionPerformed

private void btn_EditWantedActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_EditWantedActionPerformed
    if (tbl_Wanted.getSelectedRowCount() < 1) {
        JOptionPane.showMessageDialog(null, "No Bounty selected!", "Error Message", JOptionPane.WARNING_MESSAGE);
    } else {
        int _ID = Integer.parseInt(tbl_Wanted.getModel().getValueAt(tbl_Wanted.getSelectedRow(), 0).toString());
        Wanted modifiedWanted = new Wanted(_ID);
        EditWanted editWanted = new EditWanted(null, true, modifiedWanted);
        editWanted.addWindowListener(new WindowListener() {

            @Override
            public void windowOpened(WindowEvent e) {
            }

            @Override
            public void windowClosing(WindowEvent e) {
            }

            @Override
            public void windowClosed(WindowEvent e) {
                btn_RefreshWanted.doClick();
            }

            @Override
            public void windowIconified(WindowEvent e) {
            }

            @Override
            public void windowDeiconified(WindowEvent e) {
            }

            @Override
            public void windowActivated(WindowEvent e) {
            }

            @Override
            public void windowDeactivated(WindowEvent e) {
            }
        });
        editWanted.setVisible(true);
    }
}//GEN-LAST:event_btn_EditWantedActionPerformed

private void btn_AddWantedActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_AddWantedActionPerformed
    AddWanted addWanted = new AddWanted(null, true);
    addWanted.addWindowListener(new WindowListener() {

        @Override
        public void windowOpened(WindowEvent e) {
        }

        @Override
        public void windowClosing(WindowEvent e) {
        }

        @Override
        public void windowClosed(WindowEvent e) {
            btn_RefreshWanted.doClick();
        }

        @Override
        public void windowIconified(WindowEvent e) {
        }

        @Override
        public void windowDeiconified(WindowEvent e) {
        }

        @Override
        public void windowActivated(WindowEvent e) {
        }

        @Override
        public void windowDeactivated(WindowEvent e) {
        }
    });
    addWanted.setVisible(true);
}//GEN-LAST:event_btn_AddWantedActionPerformed

private void btn_FilterPrisonerActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_FilterPrisonerActionPerformed
    SimpleDateFormat formatter = new SimpleDateFormat("MM/dd/yyyy");
    ArrayList<Prisoner> resultList = new ArrayList<Prisoner>();

    HashMap parametersMap = new HashMap();
    Date _minImprisonDate = null;
    Date _maxImprisonDate = null;
    try {
        String dateString = formatter.format(spnMinImprisonDate.getValue());
        _minImprisonDate = formatter.parse(dateString);
        dateString = formatter.format(spnMaxImprisonDate.getValue());
        _maxImprisonDate = formatter.parse(dateString);
    } catch (ParseException ex) {
        Logger.getLogger(NewJFrame1.class.getName()).log(Level.SEVERE, null, ex);
    }
    parametersMap.put("MinImprisonDate", _minImprisonDate);
    parametersMap.put("MaxImprisonDate", _maxImprisonDate);
    parametersMap.put("PrisonName", txtPrisonName.getText());
    parametersMap.put("CellNumber", txtCellNumber.getText());
    Date _minReleaseDate = null;
    Date _maxReleaseDate = null;
    try {
        String dateString = formatter.format(spnMinReleaseDate.getValue());
        _minReleaseDate = formatter.parse(dateString);
        dateString = formatter.format(spnMaxReleaseDate.getValue());
        _maxReleaseDate = formatter.parse(dateString);
    } catch (ParseException ex) {
        Logger.getLogger(NewJFrame1.class.getName()).log(Level.SEVERE, null, ex);
    }
    parametersMap.put("MinReleaseDate", _minReleaseDate);
    parametersMap.put("MaxReleaseDate", _maxReleaseDate);
    String _isReleased = "";
    if (cbxIsReleased.getSelectedIndex() == 1) {
        _isReleased = "1";
    } else if (cbxIsReleased.getSelectedIndex() == 2) {
        _isReleased = "0";
    }
    parametersMap.put("IsReleased", _isReleased);
    parametersMap.put("ReleaseReason", txtReleaseReason.getText());

    if (chxHasReleaseDate.isSelected()) {
        resultList = PrisonerController.FilterPrisoner(parametersMap);
    } else {
        resultList = PrisonerController.FilterPrisonerNoReleaseDate(parametersMap);
    }
    LoadPrisonerData(resultList);
}//GEN-LAST:event_btn_FilterPrisonerActionPerformed

private void btn_ResetPrisonerActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_ResetPrisonerActionPerformed
    SimpleDateFormat formatter = new SimpleDateFormat("MM/dd/yyyy");
    Calendar cal = Calendar.getInstance();
    try {
        spnMinImprisonDate.setValue(formatter.parse("1/1/1940"));
        spnMaxImprisonDate.setValue(cal.getTime());
        spnMinReleaseDate.setValue(formatter.parse("01/01/1940"));
        spnMaxReleaseDate.setValue(cal.getTime());
    } catch (ParseException ex) {
        Logger.getLogger(NewJFrame1.class.getName()).log(Level.SEVERE, null, ex);
    }
    txtPrisonName.setText("");
    txtCellNumber.setText("");
    chxHasReleaseDate.setSelected(false);
    cbxIsReleased.setSelectedIndex(0);
    txtReleaseReason.setText("");

    btn_RefreshPrisoner.doClick();
}//GEN-LAST:event_btn_ResetPrisonerActionPerformed

private void btn_AddPrisonerActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_AddPrisonerActionPerformed
    AddPrisoner addPrisoner = new AddPrisoner(null, true);
    addPrisoner.addWindowListener(new WindowListener() {

        @Override
        public void windowOpened(WindowEvent e) {
        }

        @Override
        public void windowClosing(WindowEvent e) {
        }

        @Override
        public void windowClosed(WindowEvent e) {
            btn_RefreshPrisoner.doClick();
        }

        @Override
        public void windowIconified(WindowEvent e) {
        }

        @Override
        public void windowDeiconified(WindowEvent e) {
        }

        @Override
        public void windowActivated(WindowEvent e) {
        }

        @Override
        public void windowDeactivated(WindowEvent e) {
        }
    });
    addPrisoner.setVisible(true);
}//GEN-LAST:event_btn_AddPrisonerActionPerformed

private void btn_EditPrisonerActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_EditPrisonerActionPerformed
    if (tbl_Prisoner.getSelectedRowCount() < 1) {
        JOptionPane.showMessageDialog(null, "No Prisoner selected!", "Error Message", JOptionPane.WARNING_MESSAGE);
    } else {
        int _ID = Integer.parseInt(tbl_Prisoner.getModel().getValueAt(tbl_Prisoner.getSelectedRow(), 0).toString());
        Prisoner modifiedPrisoner = new Prisoner(_ID);
        EditPrisoner editPrisoner = new EditPrisoner(null, true, modifiedPrisoner);
        editPrisoner.addWindowListener(new WindowListener() {

            @Override
            public void windowOpened(WindowEvent e) {
            }

            @Override
            public void windowClosing(WindowEvent e) {
            }

            @Override
            public void windowClosed(WindowEvent e) {
                btn_RefreshPrisoner.doClick();
            }

            @Override
            public void windowIconified(WindowEvent e) {
            }

            @Override
            public void windowDeiconified(WindowEvent e) {
            }

            @Override
            public void windowActivated(WindowEvent e) {
            }

            @Override
            public void windowDeactivated(WindowEvent e) {
            }
        });
        editPrisoner.setVisible(true);
    }
}//GEN-LAST:event_btn_EditPrisonerActionPerformed

private void btn_DetailedPrisonerActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_DetailedPrisonerActionPerformed
    if (tbl_Prisoner.getSelectedRowCount() < 1) {
        JOptionPane.showMessageDialog(null, "No Prisoner selected!", "Error Message", JOptionPane.WARNING_MESSAGE);
    } else {
        int _ID = Integer.parseInt(tbl_Prisoner.getModel().getValueAt(tbl_Prisoner.getSelectedRow(), 0).toString());
        DetailedPrisoner detailPrisoner = new DetailedPrisoner(null, true, new Prisoner(_ID));
        detailPrisoner.setVisible(true);
    }
}//GEN-LAST:event_btn_DetailedPrisonerActionPerformed

private void btn_RefreshPrisonerActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_RefreshPrisonerActionPerformed
    prisonerList = PrisonerController.GetPrisoners();
    LoadPrisonerData(prisonerList);
}//GEN-LAST:event_btn_RefreshPrisonerActionPerformed

private void btn_ResetWantedActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_ResetWantedActionPerformed
    SimpleDateFormat formatter = new SimpleDateFormat("MM/dd/yyyy");

    Calendar cal = Calendar.getInstance();
    try {
        spnMinWantedDate.setValue(formatter.parse("01/01/1940"));
        spnMaxWantedDate.setValue(cal.getTime());
        spnMinSightingTime.setValue(formatter.parse("01/01/1940"));
        spnMaxSightingTime.setValue(cal.getTime());
    } catch (ParseException ex) {
        Logger.getLogger(NewJFrame1.class.getName()).log(Level.SEVERE, null, ex);
    }
    spnMinSightingTime.setEnabled(false);
    spnMaxSightingTime.setEnabled(false);
    spnMinBountyMoney.setValue(0);
    spnMaxBountyMoney.setValue(1000000000);
    txtSightingPlace.setText("");
    cbxInEffect.setSelectedIndex(0);

    btn_RefreshWanted.doClick();
}//GEN-LAST:event_btn_ResetWantedActionPerformed

private void btn_FilterWantedActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_FilterWantedActionPerformed
    SimpleDateFormat formatter = new SimpleDateFormat("MM/dd/yyyy");
    SimpleDateFormat SightingTimeFormat = new SimpleDateFormat("MM/dd/yyyy hh:mm:ss");
    ArrayList<Wanted> resultList = new ArrayList<Wanted>();

    HashMap parametersMap = new HashMap();
    Date _minWantedDate = null;
    Date _maxWantedDate = null;
    try {
        String dateString = formatter.format(spnMinWantedDate.getValue());
        _minWantedDate = formatter.parse(dateString);
        dateString = formatter.format(spnMaxWantedDate.getValue());
        _maxWantedDate = formatter.parse(dateString);
    } catch (ParseException ex) {
        Logger.getLogger(NewJFrame1.class.getName()).log(Level.SEVERE, null, ex);
    }
    parametersMap.put("MinWantedDate", _minWantedDate);
    parametersMap.put("MaxWantedDate", _maxWantedDate);
    parametersMap.put("MinBountyMoney", Integer.parseInt(spnMinBountyMoney.getValue().toString()));
    parametersMap.put("MaxBountyMoney", Integer.parseInt(spnMaxBountyMoney.getValue().toString()));
    parametersMap.put("SightingPlace", txtSightingPlace.getText().trim());
    Date _minSightingTime = null;
    Date _maxSightingTime = null;
    try {
        String dateString = SightingTimeFormat.format(spnMinSightingTime.getValue());
        _minSightingTime = SightingTimeFormat.parse(dateString);
        dateString = SightingTimeFormat.format(spnMaxSightingTime.getValue());
        _maxSightingTime = SightingTimeFormat.parse(dateString);
    } catch (ParseException ex) {
        Logger.getLogger(NewJFrame1.class.getName()).log(Level.SEVERE, null, ex);
    }
    parametersMap.put("MinSightingTime", _minSightingTime);
    parametersMap.put("MaxSightingTime", _maxSightingTime);
    String _inEffect = "";
    if (cbxInEffect.getSelectedIndex() == 1) {
        _inEffect = "1";
    } else if (cbxInEffect.getSelectedIndex() == 2) {
        _inEffect = "0";
    }
    parametersMap.put("InEffect", _inEffect);
    if (txtSightingPlace.getText().trim().isEmpty()) {
        resultList = WantedController.FilterWantedNotSighted(parametersMap);
    } else {
        resultList = WantedController.FilterWanted(parametersMap);
    }
    LoadWantedData(resultList);
}//GEN-LAST:event_btn_FilterWantedActionPerformed

private void txtSightingPlaceFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_txtSightingPlaceFocusLost
    if (txtSightingPlace.getText().trim().isEmpty()) {
        spnMinSightingTime.setEnabled(false);
        spnMaxSightingTime.setEnabled(false);
    } else {
        spnMinSightingTime.setEnabled(true);
        spnMaxSightingTime.setEnabled(true);
    }
}//GEN-LAST:event_txtSightingPlaceFocusLost

private void chxHasReleaseDateItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_chxHasReleaseDateItemStateChanged
    spnMinReleaseDate.setEnabled(chxHasReleaseDate.isSelected());
    spnMaxReleaseDate.setEnabled(chxHasReleaseDate.isSelected());
}//GEN-LAST:event_chxHasReleaseDateItemStateChanged

private void btn_RefreshCriminalCaseActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_RefreshCriminalCaseActionPerformed
    criminalList = CriminalController.GetCriminals();
    LoadCriminalCase(criminalList);
}//GEN-LAST:event_btn_RefreshCriminalCaseActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(NewJFrame1.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(NewJFrame1.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(NewJFrame1.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(NewJFrame1.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                new NewJFrame1().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btn_AddCriminal;
    private javax.swing.JButton btn_AddPrisoner;
    private javax.swing.JButton btn_AddWanted;
    private javax.swing.JButton btn_DetailedCriminal;
    private javax.swing.JButton btn_DetailedPrisoner;
    private javax.swing.JButton btn_DetailedWanted;
    private javax.swing.JButton btn_EditCriminal;
    private javax.swing.JButton btn_EditPrisoner;
    private javax.swing.JButton btn_EditWanted;
    private javax.swing.JButton btn_FilterCriminal;
    private javax.swing.JButton btn_FilterPrisoner;
    private javax.swing.JButton btn_FilterWanted;
    private javax.swing.JButton btn_Refresh;
    private javax.swing.JButton btn_RefreshCriminalCase;
    private javax.swing.JButton btn_RefreshPrisoner;
    private javax.swing.JButton btn_RefreshWanted;
    private javax.swing.JButton btn_ResetCriminal;
    private javax.swing.JButton btn_ResetPrisoner;
    private javax.swing.JButton btn_ResetWanted;
    private javax.swing.JComboBox cbxCriminalGender;
    private javax.swing.JComboBox cbxCriminalIsArrested;
    private javax.swing.JComboBox cbxInEffect;
    private javax.swing.JComboBox cbxIsReleased;
    private javax.swing.JCheckBox chxHasReleaseDate;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel19;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel20;
    private javax.swing.JLabel jLabel21;
    private javax.swing.JLabel jLabel22;
    private javax.swing.JLabel jLabel23;
    private javax.swing.JLabel jLabel24;
    private javax.swing.JLabel jLabel25;
    private javax.swing.JLabel jLabel26;
    private javax.swing.JLabel jLabel27;
    private javax.swing.JLabel jLabel28;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel31;
    private javax.swing.JLabel jLabel32;
    private javax.swing.JLabel jLabel33;
    private javax.swing.JLabel jLabel34;
    private javax.swing.JLabel jLabel35;
    private javax.swing.JLabel jLabel36;
    private javax.swing.JLabel jLabel37;
    private javax.swing.JLabel jLabel38;
    private javax.swing.JLabel jLabel39;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel40;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel57;
    private javax.swing.JLabel jLabel58;
    private javax.swing.JLabel jLabel59;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel60;
    private javax.swing.JLabel jLabel61;
    private javax.swing.JLabel jLabel62;
    private javax.swing.JLabel jLabel63;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel10;
    private javax.swing.JPanel jPanel11;
    private javax.swing.JPanel jPanel12;
    private javax.swing.JPanel jPanel13;
    private javax.swing.JPanel jPanel14;
    private javax.swing.JPanel jPanel15;
    private javax.swing.JPanel jPanel16;
    private javax.swing.JPanel jPanel17;
    private javax.swing.JPanel jPanel18;
    private javax.swing.JPanel jPanel19;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JPanel jPanel6;
    private javax.swing.JPanel jPanel7;
    private javax.swing.JPanel jPanel8;
    private javax.swing.JPanel jPanel9;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JScrollPane jScrollPane4;
    private javax.swing.JScrollPane jScrollPane5;
    private javax.swing.JScrollPane jScrollPane6;
    private javax.swing.JScrollPane jScrollPane7;
    private javax.swing.JScrollPane jScrollPane8;
    private javax.swing.JScrollPane jScrollPane9;
    private javax.swing.JSplitPane jSplitPane1;
    private javax.swing.JSplitPane jSplitPane2;
    private javax.swing.JSplitPane jSplitPane3;
    private javax.swing.JTabbedPane jTabbedPane1;
    private javax.swing.JLabel lblCaseTime;
    private javax.swing.JLabel lblCaseType;
    private javax.swing.JLabel lblInvolvements;
    private javax.swing.JSpinner spnMaxBountyMoney;
    private javax.swing.JSpinner spnMaxCriminalArrestTime;
    private javax.swing.JSpinner spnMaxCriminalDOB;
    private javax.swing.JSpinner spnMaxCriminalHeight;
    private javax.swing.JSpinner spnMaxCriminalWeight;
    private javax.swing.JSpinner spnMaxImprisonDate;
    private javax.swing.JSpinner spnMaxReleaseDate;
    private javax.swing.JSpinner spnMaxSightingTime;
    private javax.swing.JSpinner spnMaxWantedDate;
    private javax.swing.JSpinner spnMinBountyMoney;
    private javax.swing.JSpinner spnMinCriminalArrestTIme;
    private javax.swing.JSpinner spnMinCriminalDOB;
    private javax.swing.JSpinner spnMinCriminalHeight;
    private javax.swing.JSpinner spnMinCriminalWeight;
    private javax.swing.JSpinner spnMinImprisonDate;
    private javax.swing.JSpinner spnMinReleaseDate;
    private javax.swing.JSpinner spnMinSightingTime;
    private javax.swing.JSpinner spnMinWantedDate;
    private javax.swing.JTable tbl_CriminalCase;
    private javax.swing.JTable tbl_CriminalRecord;
    private javax.swing.JTable tbl_Criminals;
    private javax.swing.JTable tbl_Prisoner;
    private javax.swing.JTable tbl_Wanted;
    private javax.swing.JTextArea txtCaseDescriptions;
    private javax.swing.JTextArea txtCaseInvolvements;
    private javax.swing.JTextArea txtCasePlace;
    private javax.swing.JTextField txtCellNumber;
    private javax.swing.JTextField txtCriminalAliases;
    private javax.swing.JTextField txtCriminalFullName;
    private javax.swing.JTextField txtCriminalHair;
    private javax.swing.JTextField txtCriminalNationality;
    private javax.swing.JTextField txtCriminalPlaceOfBirth;
    private javax.swing.JTextField txtCriminalRace;
    private javax.swing.JTextField txtPrisonName;
    private javax.swing.JTextArea txtReleaseReason;
    private javax.swing.JTextField txtSightingPlace;
    // End of variables declaration//GEN-END:variables

    private void LoadCriminalData(ArrayList<Criminal> listToLoad) {
        DefaultTableModel dtm = (DefaultTableModel) tbl_Criminals.getModel();
        while (dtm.getRowCount() > 0) {
            dtm.removeRow(0);
        }
        Vector row;
        SimpleDateFormat DOBFormat = new SimpleDateFormat("MM/dd/yyyy");
        SimpleDateFormat ArrestedTimeFormat = new SimpleDateFormat("MM/dd/yyyy hh:mm:ss");
        //Now we loop through the criminal list to get what we need
        if (listToLoad != null) {
            for (int i = 0; i < listToLoad.size(); i++) {
                Criminal _criminal = listToLoad.get(i);
                row = new Vector();
                row.addElement(_criminal.getID());
                row.addElement(_criminal.getFullName());
                //For Gender column, we must do a gender check
                if (_criminal.isGender()) {
                    row.addElement("Male");
                } else {
                    row.addElement("Female");
                }
                row.addElement(DOBFormat.format(_criminal.getDateOfBirth()));
                row.addElement(_criminal.getNationality());
                row.addElement(_criminal.isIsArrested());
                //Make sure that null arrested time will not be formatted
                if (_criminal.getArrestedTime() != null) {
                    row.addElement(ArrestedTimeFormat.format(_criminal.getArrestedTime()));
                }
                dtm.addRow(row);
            }
        }
    }

    private void LoadWantedData(ArrayList<Wanted> listToLoad) {
        DefaultTableModel dtm = (DefaultTableModel) tbl_Wanted.getModel();
        while (dtm.getRowCount() > 0) {
            dtm.removeRow(0);
        }
        Vector row;
        SimpleDateFormat WDFormat = new SimpleDateFormat("MM/dd/yyyy");
        if (listToLoad != null) {
            for (int i = 0; i < listToLoad.size(); i++) {
                Wanted _wanted = listToLoad.get(i);
                row = new Vector();
                row.addElement(_wanted.getID());
                row.addElement(_wanted.getRelatedCriminal().getFullName());
                row.addElement(WDFormat.format(_wanted.getWantedDate()));
                row.addElement(_wanted.getBountyMoney());
                row.addElement(_wanted.isInEffect());
                dtm.addRow(row);
            }
        }
    }

    private void LoadPrisonerData(ArrayList<Prisoner> listToLoad) {
        DefaultTableModel dtm = (DefaultTableModel) tbl_Prisoner.getModel();
        while (dtm.getRowCount() > 0) {
            dtm.removeRow(0);
        }
        Vector row;
        SimpleDateFormat IDFormat = new SimpleDateFormat("MM/dd/yyyy");
        if (listToLoad != null) {
            for (int i = 0; i < listToLoad.size(); i++) {
                Prisoner _prisoner = listToLoad.get(i);
                row = new Vector();
                row.addElement(_prisoner.getID());
                row.addElement(_prisoner.getRelatedCriminal().getFullName());
                row.addElement(IDFormat.format(_prisoner.getImprisonDate()));
                if (_prisoner.getReleaseDate() == null) {
                    row.addElement("None");
                } else {
                    row.addElement(IDFormat.format(_prisoner.getReleaseDate()));
                }
                row.addElement(_prisoner.getPrisonName());
                row.addElement(_prisoner.isIsReleased());
                dtm.addRow(row);
            }
        }
    }

    private void LoadCriminalCase(ArrayList<Criminal> listToLoad) {
        DefaultTableModel dtm = (DefaultTableModel) tbl_CriminalCase.getModel();
        while (dtm.getRowCount() > 0) {
            dtm.removeRow(0);
        }
        Vector row;
        if (listToLoad != null) {
            for (int i = 0; i < listToLoad.size(); i++) {
                Criminal _criminal = listToLoad.get(i);
                row = new Vector();
                row.addElement(_criminal.getID());
                row.addElement(_criminal.getFullName());
                dtm.addRow(row);
            }
        }
    }

    private ListSelectionListener tbl_CriminalCaseSelected() {
        return new ListSelectionListener() {

            @Override
            public void valueChanged(ListSelectionEvent e) {
                if (e.getValueIsAdjusting()) {
                    DefaultTableModel dtm = (DefaultTableModel) tbl_CriminalRecord.getModel();
                    while (dtm.getRowCount() > 0) {
                        dtm.removeRow(0);
                    }
                    if (tbl_CriminalCase.getSelectedRowCount() > 0) {
                        try {
                            int _ID = Integer.parseInt(tbl_CriminalCase.getModel().getValueAt(tbl_CriminalCase.getSelectedRow(), 0).toString());
                            ResultSet rs = CriminalController.getCriminalPerCase(_ID);

                            if (rs.next()) {
                                rs.beforeFirst();
                                while (rs.next()) {
                                    Vector row = new Vector();
                                    row.addElement(rs.getInt("CaseID"));
                                    row.addElement(rs.getString("Charge"));
                                    row.addElement(rs.getString("RoleInCase"));
                                    dtm.addRow(row);
                                }
                            }
                        } catch (SQLException ex) {
                            Logger.getLogger(NewJFrame1.class.getName()).log(Level.SEVERE, null, ex);
                        }
                    }
                }
            }
        };
    }

    private ListSelectionListener tbl_CriminalRecordSelected() {
        return new ListSelectionListener() {

            @Override
            public void valueChanged(ListSelectionEvent e) {
                if (e.getValueIsAdjusting()) {
                    if (tbl_CriminalRecord.getSelectedRowCount() > 0) {
                        try {
                            int _caseID = Integer.parseInt(tbl_CriminalRecord.getModel().getValueAt(tbl_CriminalRecord.getSelectedRow(), 0).toString());
                            int _criminalID = Integer.parseInt(tbl_CriminalCase.getModel().getValueAt(tbl_CriminalCase.getSelectedRow(), 0).toString());
                            ResultSet rs = CriminalController.getCaseDetailPerCriminal(_criminalID, _caseID);

                            if (rs.next()) {
                                lblCaseType.setText(rs.getString("CaseType"));
                                SimpleDateFormat formattter = new SimpleDateFormat("MM/dd/yyyy");
                                lblCaseTime.setText(formattter.format(rs.getDate("CaseTime")));
                                txtCasePlace.setText(rs.getString("CasePlace"));
                                txtCaseInvolvements.setText(rs.getString("CaseInvolvements"));
                                txtCaseDescriptions.setText(rs.getString("CaseDescriptions"));
                            }
                        } catch (SQLException ex) {
                            Logger.getLogger(NewJFrame1.class.getName()).log(Level.SEVERE, null, ex);
                        }
                    }
                }
                if (tbl_CriminalRecord.getSelectedRowCount() < 1) {
                    lblCaseType.setText("");
                    lblCaseTime.setText("");
                    txtCasePlace.setText("");
                    txtCaseInvolvements.setText("");
                    txtCaseDescriptions.setText("");
                }
            }
        };
    }
}
